<template>
	<view class="pageDiv">
		<button type="primary" @click="bindAppInfo">扫描绑定移动端</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
			}
		},
		onLoad() {
			
		},
		mounted(){
			
		},
		methods:{
			bindAppInfo(){
				uni.scanCode({
					success: function (res) { 
						// 二维码数据格式 
						uni.setStorageSync('appInfoKey',res.result);
						uni.redirectTo({
							url: '/pages/index/index'
						});
					},
					fail:function(res) {
						uni.showToast({
						  title: '扫码失败',
						  icon: data.icon || 'none', 
						  duration: data.duration || 2500 ,
						  mask: false
						});
					}
				});
			}
		}
	}
</script>

<style>
	.pageDiv{
		width: 100vw;
		height: 100vh;
		display: flex;
		justify-content: center;
		align-items: center;
	}
</style>